<!--
 * @Descripttion:
 * @Author: Silence
 * @Date: 2023-06-02 20:13:16
 * @LastEditors: Silence
 * @LastEditTime: 2023-06-02 21:24:49
-->
<template>
  <div>
    御剑乘风来,除魔天地间!===father===num:{{ $store.state.num }}=={{ num }}
    <br /><button @click="add">按钮</button>
    <Son></Son>
    sum:{{ sum }}==={{ $store.getters.sum }} <br /><button @click="addMoudle">
      按钮==moudle</button
    >===moudle:{{ $store.state.user.userInfo.name }}==num:{{
      $store.state.setting.num
    }}
  </div>
</template>
<script>
import Son from './Son.vue'
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
export default {
  components: {
    Son
  },
  name: '',
  data () {
    return {

    }
  },
  created () {
    console.log(this)
  },
  computed: {
    ...mapState(['num']),
    ...mapGetters(['sum'])
  },
  methods: {
    ...mapMutations(['handle1']),
    ...mapActions(['handle3']),
    add () {
      // this.$store.commit('handle')
      // this.handle1(2)
      // this.$store.commit('handle1', 2)
      // this.$store.dispatch('handle2')
      // this.handle3(2)
    },
    ...mapMutations('setting', ['changeNum']),
    addMoudle () {
      // this.$store.commit('setting/changeNum')
      this.changeNum()
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
